New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@techor/fs

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@techor/fs

A human-friendly file system


Version published
Weekly downloads
66
decreased by-36.54%
Maintainers
1
Weekly downloads
 
Created

A human-friendly file system

NPM Version NPM Version NPM package ( download / month ) Follow @mastercorg Github release actions


Getting Started

npm install @techor/fs

Usage

readFileSync(filepath: string, options?: Options): Buffer
readFileAsNormalizedStrSync(filepath: string, options?: Options): string
readJSONFileSync(filepath: string, options?: Options): any

writeToFile(filePath: string, data: any, options?: WriteToFileOptions): void

a.json

{ "name": "a" }

b.json

{ "name": "b" }
import { readFileSync } from '@techor/fs'

readFileSync('a.*')
// Buffer

readFileSync('./fewjiogw/wiefoiwe')
// undefined

readFileAsNormalizedStrSync('a.*')
// '{ "name": "a" }'

readJSONFileSync('./package.json')
// { "name": "root", ... }

readJSONFileSync('./package.json')
// { "name": "a", ... }

Options

declare type Options = ObjectEncodingOptions & { encoding?: BufferEncoding | null }

NPM Version

FAQs

Package last updated on 16 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts